import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)


const state = {
    token: "",
    username: "",
    login: true
}

const mutations = {
    logout(state) {
        state.login = false;
        state.token = ""
        state.username = ""
    },
    login(state,username,token){
        state.login = true;
        state.username = username;
        state.token = token
    }
}

const actions = {

}

export default new Vuex.Store({
    state,
    mutations,
    actions
})